<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;

$this->title = 'create';
?>


<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box-header"><h2 class="box-title"><?php if ($model->id){?>修改管理员<?php } else {?>新增管理员<?php }?></h2></div>
      <div class="box-body add_department">
        <?php $form = ActiveForm::begin(['action' => ['user/create', 'id' => $model->id], 'method' => 'post']);?>
          <div class="box-body">
            <div class="form-group">
              <label>用户名</label>
              <?=Html::textInput('username', $model->username, ['class' => 'form-control', 'placeholder' => '请输入用户名']);?>
              <?=Html::error($model, 'username', ['style' => 'color:red'])?>
            </div>
            <div class="form-group">
              <label>密码</label>
              <?=Html::textInput('password', $model->password, ['class' => 'form-control', 'placeholder' => '请输入密码']);?>
              <?=Html::error($model, 'password', ['style' => 'color:red'])?>
            </div>
            <div class="form-group">
              <label>确认密码</label>
              <?=Html::textInput('confirm_password', $model->confirm_password, ['class' => 'form-control', 'placeholder' => '确认密码']);?>
              <?=Html::error($model, 'confirm_password', ['style' => 'color:red'])?>
            </div>
            <div class="form-group">
              <label>分配员工</label>
              <?=Html::dropDownList('eid', $model->eid, ArrayHelper::map($employee, 'id', 'realname'), ['class'=>'form-control']);?>
              <?=Html::error($model, 'eid', ['style' => 'color:red'])?>
            </div>
          </div>
          <div class="box-footer">
            <button type="submit" class="btn btn-primary">确定</button>
          </div>
        <?php ActiveForm::end();?>
      </div>
    </div>
  </div>
</section>